﻿Namespace Choreography
    Public Class ActivitySequence

#Region "Member Fields"
        Private _tempoInHertz As UInt32
        Private _activities As List(Of Choreography.IRabbitActivity)
#End Region

#Region "Properties"
        Public Property TempoInHertz() As UInt32
            Get
                Return _tempoInHertz
            End Get
            Set(ByVal value As UInt32)
                _tempoInHertz = value
            End Set
        End Property

        Public ReadOnly Property Activities() As List(Of Choreography.IRabbitActivity)
            Get
                If _activities Is Nothing Then
                    _activities = New List(Of Choreography.IRabbitActivity)
                End If
                Return _activities
            End Get
        End Property
#End Region

#Region "Methods"
        Public Function GetSequenceCommand() As String
            Dim choreographyBuilder As New System.Text.StringBuilder
            choreographyBuilder.Append(Me.TempoInHertz)
            For Each activity As Choreography.IRabbitActivity In Me.Activities
                choreographyBuilder.AppendFormat(",{0}", activity.GetCommandString)
            Next
            Return choreographyBuilder.ToString
        End Function
#End Region

    End Class
End Namespace
